/********************************************************************
	Coder: vincent
	E-Mail:	vincent213@live.cn
*********************************************************************/

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public struct ActionStaticData 
{

	public string m_strName;
	public ActionPlayMode    m_ActPlayMode;
	public float m_fActionSpeed;
	
	public float  m_fDuration;
	public int    m_nPriority;
	public int    m_nActionID;
	public string m_strAnimName;
	public string m_strEndToAction;
	
	public bool   m_bUseAnimTime;
	

	public int      m_AnimLayer;
	public bool     m_bFadeAnim;
	public WrapMode m_AnimWrapMode;
	public float    m_AnimSpeed;
    public bool     m_bTurnToAttackTarget;
	public bool     m_bUseAnimMove;
	
	public ActionPhysicsType m_PhysicsType;
	
	public List<CancelData> vecCancelData;
	public List<HitData> vecHitData;
	public List<EffectData> vecEffectData;
	public List<ForceData> vecForceData;

    public List<string> vecCommnad;

    public bool m_bUseDeafaultAction;
	

	public object Clone()
    {
        //return this as object;      
        return this.MemberwiseClone(); 
        //return new GameEffectSetting() as object;
    }
	
	public void AddCancelData(float fStartTime,float fEndTime,string strCancelActions)
	{
	
		CancelData canceldata = new CancelData();
		if(fStartTime > 0)
			canceldata.fStartTime = fStartTime*100*33.33f/1000.0f;
		else
			canceldata.fStartTime = fStartTime;
		if(fEndTime > 0)
			canceldata.fEndTime = fEndTime*100*33.33f/1000.0f;
		else
			canceldata.fEndTime = fEndTime;
		canceldata.strCancelActions = strCancelActions;
		vecCancelData.Add(canceldata);
	}
	
	public void AddHitData(float fStartTime,float fEndTime,float fStepTime,int nCount,string strHitName)
	{
	
		HitData hitdata = new HitData();
		hitdata.fStartTime = fStartTime*100*33.33f/1000.0f;
		hitdata.fEndTime = fEndTime*100*33.33f/1000.0f;
		hitdata.strHitName = strHitName;
		hitdata.fTimeStep = fStepTime*100*33.33f/1000.0f;
		hitdata.nMaxCount = nCount;
		
		//
		//AnimationEvent hitEvent = new AnimationEvent();
		//hitEvent.functionName = "HitCallBack";
		//hitEvent.time = fStartTime;
		//hitEvent.stringParameter = strHitName;
		//m_GameOBJ.animation.GetClip(m_strAnimName).AddEvent(hitEvent);
		vecHitData.Add(hitdata);
	}
	
	public void AddEffectData(float fStartTime,float fEndTime,float fStepTime,int nMaxCount,string strEffectData)
	{
	
		EffectData effectData = new EffectData();
		effectData.fStartTime = fStartTime*100*33.33f/1000.0f;
		effectData.fEndTime = fEndTime*100*33.33f/1000.0f;
		effectData.strEffectName = strEffectData;
		effectData.fTimeStep = fStepTime*100*33.33f/1000.0f;
		effectData.nMaxCount = nMaxCount;
		
		vecEffectData.Add(effectData);
	}
	
	public void AddForceData(float fStartTime,Vector3 vForce)
	{
		ForceData forceData = new ForceData();
		forceData.fStartTime = fStartTime*100*33.33f/1000.0f;
		forceData.vForce = vForce;
		
		vecForceData.Add(forceData);
	}
}